<template>
  <div>
      <van-divider
        :style="{ color: '#1989fa', borderColor: '#1989fa', padding: '0 16px' }"
        >
        商品详情
        </van-divider>
        <van-card
          :price="item.goods.goodsPrice"
          :title="item.goods.goodsName"
          :desc="item.cdk"
          :thumb="item.goods.goodsCoverImg"
          v-for="item in orderItem"
          :key="item.goodsId"
        >
        </van-card>
  </div>
</template>

<script>
export default {
    data() {
        return {
            orderItem: []
        }
    },
    created() {
        this.getOrderItem()
    },
    methods: {
        async getOrderItem() {
            const orderId = this.$route.params.orderId
            const {data: res} = await this.$http.post("/api/order/getOrderItem",{orderId: orderId})
            if (res.code !== 200) {
                this.$toast('详情加载失败')
                return
            }
            this.orderItem = res.data
        }
    }
}
</script>

<style lang="less" scoped>

</style>